

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Flight;

import service.AirlineReservationServiceProxy;
import constants.AirlineReservationServiceConstants;

/**
 * Servlet implementation class GetFlightDetailsServlet
 */
@SuppressWarnings("serial")
public class GetFlightDetailsServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		
	
		AirlineReservationServiceProxy proxy = new AirlineReservationServiceProxy(
				AirlineReservationServiceConstants.SERVICE_URL);

		
				long ids[] = new long[1];
				ids[0] = Long.parseLong(req.getParameter("id")) ;
					Flight[] flights = proxy.getFlightDetails(ids);
					
					

                    
						
					req.setAttribute("flight", flights[0]);
					req.getRequestDispatcher("editFlights.jsp").forward(req, resp);
						
						
						

				}



	}


	

